{% extends 'layout.html' %}

{# Set variables for base layour #}
{% set active_page = 'user' %}
{% set title = '' %}

{% block content %}

    <div class="user_activity">

        {% for post in posts %}
            
            <div>
                {# Post title #}
                {% if post.link|length > 0 %}
                    <a href="{{ post.link }}">
                        {{ post.title }}
                    </a>
                {% else %}
                    <a href="../post/{{ post.hashId }}">
                        {{ post.title }}
                    </a>
                {% endif %}
                
                {# Post info #}
                <div class="info">
                    {{ post.vote }} votes,
                    <time title="{{ post.created|title }}" datetime="{{ post.created|datetime }}"><em> {{ post.created|ago }} </em></time>
                    —
                    <a href="../post/{{ post.hashId }}">{{ post.commentsCount }} comments</a>
                </div>
            </div>
            
        {% endfor %}

    </div>
        
{% endblock %}
